package com.rr.learningdemo.stream.controller;

import com.rr.learningdemo.pojo.Person;
import com.rr.learningdemo.stream.service.SendMessageService;
import com.rr.learningdemo.stream.service.impl.SendMessageServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhuangcanrun
 * @Date 2021/06/15/17:31
 * @description
 **/

@RestController
public class SendMessageController {
    @Autowired
    private SendMessageServiceImpl sendMessageService;

//    @GetMapping("/sendByOutput/{message}")
//    public String sendMessageByOutput(@PathVariable("message") String message) {
//        sendMessageService.sendMessageByOutput(message);
//        return message;
//    }
//
//    @GetMapping("/sendByMyOutput/{message}")
//    public String sendByMyOutput(@PathVariable("message") String message) {
//        sendMessageService.sendMessageByMyOutput(message);
//        return message;
//    }

//    @GetMapping("/sendPersonByOutput")
//    public Person sendPersonByOutput(Person person) {
//        sendMessageService.sendPersonByOutput(person);
//        return person;
//    }

    @GetMapping("/send/{message}")
    public String send(@PathVariable("message") String message) {
        sendMessageService.sendMethod();
        return message;
    }
}
